package com.itheima.day03Dome03;

import com.sun.xml.internal.ws.util.StringUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Date01 {
    public static void main(String[] args) throws ParseException {
        /*Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个日期（yyyy-MM-dd）");
        String next = scanner.next();

        //获取日期并转化获取毫秒值
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        long parse = simpleDateFormat.parse(next).getTime();

        //获取当前时间
        long timeMillis = System.currentTimeMillis();

        if (parse > timeMillis) {
            System.out.println("生日必须早于当前时期");
        } else {
            System.out.println("您的生日为:" + (timeMillis - parse) / 1000 / 3600 / 24);
        }*/


        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入第一个日期（yyyy-MM-dd）");
        String next1 = scanner.next();
        System.out.println("请输入第二个日期（yyyy-MM-dd）");
        String next2 = scanner.next();

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        long time1 = simpleDateFormat.parse(next1).getTime();

        long time2 = simpleDateFormat.parse(next2).getTime();

        if (time1 < time2) {
            System.out.println(next1 + "的生日大");
        } else {
            System.out.println(next2 + "的生日大");
        }
        }



}

